<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.example.studentgrades.model.Admin" %>
<%
  Admin admin = (Admin) session.getAttribute("admin");
  if (admin == null) {
    response.sendRedirect("admin_login.jsp");
    return;
  }
%>
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>管理员主页</title>
  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container mt-5">
  <h2 class="text-center">欢迎, <%= admin.getUsername() %></h2>
  <div class="list-group mt-4">
    <a href="manage_students.jsp" class="list-group-item list-group-item-action">管理学生</a>
    <a href="manage_scores.jsp" class="list-group-item list-group-item-action">管理成绩</a>
    <a href="<%= request.getContextPath() %>/admin_login.jsp" class="list-group-item list-group-item-action">退出</a>
  </div>
</div>
</body>
</html>
